package com.sun.temp.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.sun.temp.dto.TempDto;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

@Data
@TableName(value = "material")
public class Material implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.INPUT)
    private Integer id;

    @TableField(value = "task_id")
    private Integer taskId;

    @TableField(value = "batch")
    private String batch;

    @TableField(value = "grade")
    private String grade;

    @TableField(value = "tempa", typeHandler = FastjsonTypeHandler.class)
    private TempDto tempa;

    @TableField(value = "tempb", typeHandler = FastjsonTypeHandler.class)
    private TempDto tempb;

    @TableField(value = "tempc", typeHandler = FastjsonTypeHandler.class)
    private TempDto tempc;

    @TableField(value = "tempd", typeHandler = FastjsonTypeHandler.class)
    private TempDto tempd;

    @TableField(value = "resulta")
    private Double resulta;

    @TableField(value = "resultb")
    private Double resultb;

    @TableField(value = "resultc")
    private Double resultc;

    @TableField("create_time")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private Date create_time;

    @TableField(value = "status")
    private Integer status;

    @TableField(value = "file_path")
    private String filePath;

    @TableField(exist = false)
    private Integer totalCount;

    @TableField(exist = false)
    private Integer successCount;
}
